package com.abysscore.yachtdesign;

import java.awt.Color;

import com.abysscore.yachtdesign.delphi.TBrushStyle;
import com.abysscore.yachtdesign.delphi.TComponent;
import com.abysscore.yachtdesign.delphi.TMessage;
import com.abysscore.yachtdesign.delphi.TMouseMoveEvent;
import com.abysscore.yachtdesign.delphi.TScrollbar;
import com.abysscore.yachtdesign.view.TBitmap;
import com.abysscore.yachtdesign.view.TCanvas;

public class TFreeViewport {
	private double FAngle;
	private double FDistance;              // The distance from the model to the camera, determined by the field of view
	private double FElevation;
	private double FFieldOfView;              // The field of view in degrees, default=50 degr. which corresponds with the human eye
	private boolean FDoubleBuffer;                 // Double buffering prevents flickering when redrawing the viewport
	private boolean FPrinting;                 // Switch to determine if the viewport is drawing to the screen, or to the printer (or bitmap)
	private int FPrintResolution;                 // horizontal reolution of the printer
	private int FDestinationWidth;                 // Destinationwidth of the canvas when not drawing to the screen
	private int FDestinationHeight;                 // DestinationHeight of the canvas when not drawing to the screen
	private T3DCoordinate FMin3D,FMax3D;
	private T3DCoordinate FMidPoint;           // Midpoint of the boundarybox determined by FMin3D and FMax3D. This point is used as centerpoint for rotating the 3D model
	private double FMargin;              // margin around to viewport to keep clear;
                                                          // and it also is the direction at which the camera looks
	private TFreeViewportBackgroundMode FBackgroundMode;
	private TFreeviewType FViewType;           // Switch to sideview, frontview, topview or perspective view
	private T3DCoordinate FCameraLocation;           // Position of the camera, following from the field of view and the distance of the camera
	private TFreeCameraType FCameraType;         // Determines the focalpoint of the camera
	private double FCosAngle,FSinAngle;              // Pre calculated values to speed-up the rotating of point in the perspective-projection
	private double FCosElevation,FSinElevation;              // Pre calculated values to speed-up the rotating of point in the perspective-projection
	private double FScale;              // Scale for projecting the 2D coordinates to the viewport
	private double FPrintScaleFactor;              // Scale factor to adapt penwith depending on printsize and printresolution
	private double FZoom;
	private TFreeViewportmode FViewportMode;       // Switch between wireframe mode or differentypes of shading
	private TCanvas FDrawingCanvas;
	private TBitmap FDrawingBuffer;                 // Drawingbuffer to prevent flickering. Everything is drawn on this bitmap, and then copied to the screen
	private TMouseEvent FOnMouseDown;
	private TMouseEvent FOnMouseUp;
	private TNotifyEvent FOnMouseEnter;
	private TMouseEvent FOnMouseMove;
	private TNotifyEvent FOnMouseLeave;
	private TNotifyEvent FOnRedraw;
	private TNotifyEvent FOnChangeViewType;
	private TNotifyEvent FOnRequestBackgroundImage;
	private TOnRequestExtentsEvent FOnRequestExtents;
	private TPoint FScreencenter;
	private TPoint FPan;
	private TPoint FPreviousPosition;
	private TPoint FBackgroundOrigin;
	private TFreeBackgroundImage FBackgroundImage;
    // shade data
	private TFreeZBuffer FZBuffer;
	private TFreeAlphaBuffer FAlphaBuffer;
	private TFreeLight FLight;
	private TScrollbar FHorScrollbar;
	private TScrollbar FVertScrollbar;
	private TNotifyEvent FOnChangeBackgroundImage;


	private Color FGetBrushColor()
	{
		return null;
	}
	private TBrushStyle FGetBrushStyle()
	{
		return null;
	}
	private Color FGetFontColor()
	{
		return null;
	}
	private String FGetFontName()
	{
		return null;
	}
	private int FGetFontSize()
	{
		return 0;
	}
	private Color FGetPenColor()
	{
		return null;
	}
	private TPenStyle  FGetPenStyle()
	{
		return null;
	}
	private int FGetPenWidth()
	{
		return 0;
	}
	private boolean FGetPrinting()
	{
		return false;
	}
	private void FSetAngle(double Val)
	{
		;
	}
	private void FSetBackgroundMode(TFreeViewportBackgroundMode val)
	{
		;
	}
	private void FSetBrushColor(Color Val)
	{
		;
	}
	private void FSetBrushStyle(TBrushStyle Val)
	{
		;
	}
	private void FSetCameraType(TFreeCameraType Val)
	{
		;
	}
	private void FSetElevation(double Val)
	{
		;
	}
	private void FSetFontColor(Color Val)
	{
		;
	}
	private void FSetFontName(String val)
	{
		;
	}
	private void FSetFontSize(int val)
	{
		;
	}
	private void FSetHorScrollbar(TScrollbar val)
	{
		;
	}
	private void FSetVertScrollbar(TScrollbar val)
	{
		;
	}
	private void FSetMargin(double Val)
	{
		;
	}
	private void FSetPan(TPoint Val)
	{
		;
	}
	private void FSetPenColor(Color Val)
	{
		;
	}
	private void FSetPenStyle(TPenStyle Val)
	{
		;
	}
	private void FSetPenWidth(int Val)
	{
		;
	}
	private double FGetPrintScaleFactor()
	{
		return 0.0;
	}
	private void FSetViewType(TFreeviewType Val)
	{
		;
	}
	private void FSetViewportMode(TFreeViewportmode Val)
	{
		;
	}
	private void FHorScrollbarChange(Object sender)
	{
		;
	}
	private void FVertScrollbarChange(Object sender)
	{
		;
	}
	private void WMMouseEnter(TMessage Message)
	{
		;
	}// message CM_MOUSEENTER;
	private void WMMouseLeave(TMessage Message)
	{
		;
	}// message CM_MOUSELEAVE;
	
	
 
	protected void Paint()
	{
		;
	}  //                                                      override;
	protected void Resize()
	{
		;
	} //                                                      override;
	protected void KeyPress(char Key)
	{
		;
	} //                                      override;
	protected void MouseDown(TMouseButton Button, TShiftState Shift, int X, int Y)
	{
		;
	} // override;
	protected void MouseMove(TShiftState Shift, int X, int Y)
	{
		;
	}      //               override;
	protected void MouseUp(TMouseButton Button, TShiftState Shift, int X, int Y)
	{
		;
	}  // override;
	protected boolean DoMouseWheel(TShiftState Shift, int WheelDelta, TPoint MousePos)
	{
		return false;
	}
	
	
 
	public  TFreeViewport(TComponent AOwner)
	{
		;
	}//                                  override;
	//public  destructor Destroy;                                                     override;
	public void DrawLineToZBuffer(T3DCoordinate Point1, T3DCoordinate Point2, int R, int G, int B)
	{
		;
	}
	public void InitializeViewport(T3DCoordinate Min, T3DCoordinate Max)
	{
		;
	}
	public void Print(TFreeUnitType Units, boolean AskPrintScale, String Jobname)
	{
		;
	}
	public TPoint Project(T3DCoordinate P)
	{
		return null;
	}
	public T3DCoordinate ProjectBack(TPoint P, T3DCoordinate Input)
	{
		return null;
	}
	public T2DCoordinate ProjectBackTo2D(TPoint P)
	{
		return null;
	}        // Takes the cursor position and projects it to 2D object space
	public TShadePoint ProjectToZBuffer(T3DCoordinate P)
	{
		return null;
	} // overload;virtual;// Projects a 3D point to the screen and calculate it's Z-value for the Z-buffer
	public TShadePoint ProjectToZBuffer(double Scale,T3DCoordinate P)
	{
		return null;
	} // reintroduce;overload;// Projects a 3D point with a certain z-buffer offset to the screen, used for drawing lines on top of shaded surfaces
	public T3DCoordinate RotatedPoint(T3DCoordinate P)
	{
		return null;
	}
	public T3DCoordinate RotatedPointBack(T3DCoordinate P)
	{
		return null;
	}
	public void SaveAsBitmap(String Filename, boolean ShowDialog)
	{
		;
	}
	public void SetPenWidth(int Width)
	{
		;
	}
	public void ShadedColor(int Dp, int R, int G,int B, int ROut, int GOut, int BOut)
	{
		;
	}
	public void ShadeTriangle(T3DCoordinate P_1, T3DCoordinate P_2, T3DCoordinate P_3, int R, int G,int B, int Alpha)
	{
		;
	}//overload;virtual;
	public void ShadeTriangle(T3DCoordinate P_1, T3DCoordinate P_2, T3DCoordinate P_3, int C1,int C2,int C3)
	{
		;
	} //reintroduce;overload;
	public void ShadeTriangle(T3DCoordinate P_1, T3DCoordinate P_2, T3DCoordinate P_3, int R1, int G1, int B1, int R2,int G2,int B2,int R3,int G3,int B3)
	{
		;
	} //reintroduce;overload;
	public void ZoomIn()
	{
		;
	}
	public void ZoomExtents()
	{
		;
	}
	public void ZoomOut()
	{
		;
	}
	
	
	public TFreeAlphaBuffer AlphaBuffer() { return FAlphaBuffer; }
	public TFreeViewportBackgroundMode BackgroundMode() { return FBackgroundMode; }
	public void BackgroundMode(TFreeViewportBackgroundMode val) { FSetBackgroundMode(val); }
	public Color BrushColor() { return FGetBrushColor(); }
	public void BrushColor(Color val) { FSetBrushColor(val); }
	public TBrushStyle BrushStyle() { return FGetBrushStyle(); }
	public void BrushStyle(TBrushStyle val) { FSetBrushStyle(val); }
	public T3DCoordinate CameraLocation() { return FCameraLocation; }
	public TCanvas DrawingCanvas() { return FDrawingCanvas; }
	public double FieldOfView() { return FFieldOfView; }
	public Color FontColor() { return FGetFontColor(); }
	public void FontColor(Color val) { FSetFontColor(val); }
	public String FontName() { return FGetFontName(); }
	public void FontName(String val) { FSetFontName(val); }
	public int FontSize() { return FGetFontSize(); }
	public void FontSize(int val) { FSetFontSize(val); }
	public TFreeLight Light() { return FLight; }
	public T3DCoordinate Max3D() { return FMax3D; }
	public T3DCoordinate Min3D() { return FMin3D; }
	public Color PenColor() { return FGetPenColor(); }
	public void PenColor(Color val) { FSetPenColor(val); }
	public TPenStyle PenStyle() { return FGetPenStyle(); }
	public void PenStyle(TPenStyle val) { FSetPenStyle(val); }
	public int PenWidth() { return FGetPenWidth(); }
	public void PenWidth(int val) { FSetPenWidth(val); }
	public boolean Printing() { return FGetPrinting(); }
	public int PrintResolution() { return FPrintResolution; }
	public double PrintScaleFactor() { return FGetPrintScaleFactor(); }
	public double Scale() { return FScale; }
	public TFreeZBuffer ZBuffer() { return FZBuffer; }
	public double Zoom() { return FZoom; }
	public double Angle() { return FAngle; }
	public void Angle(double val) { FSetAngle(val); }
	//public property Align();
	public TFreeBackgroundImage BackgroundImage() { return FBackgroundImage; }
	public void BackgroundImage(TFreeBackgroundImage val) { FBackgroundImage=val; }
	//public property BevelInner();
	//public property BevelOuter();
	//public property BorderStyle();
	public TFreeCameraType CameraType() { return FCameraType; }
	public void CameraType(TFreeCameraType val) { FSetCameraType(val); }
	public void Color(Color val) { 
		; //TODO 
	}
	public boolean DoubleBuffer() { return FDoubleBuffer; }
	public void DoubleBuffer(boolean val) { FDoubleBuffer=val; }
	public double Elevation() { return FElevation; }
	public void Elevation(double val) { FSetElevation(val); }
	public TScrollbar HorScrollbar() { return FHorScrollbar; }
	public void HorScrollbar(TScrollbar val) { FSetHorScrollbar(val); }
	public double Margin() { return FMargin; }
	public void Margin(double val) { FSetMargin(val); }
	public TPoint Pan() { return FPan; }
	public void Pan(TPoint val) { FSetPan(val); }
	//public property PopupMenu();
	public TScrollbar VertScrollbar() { return FVertScrollbar; }
	public void VertScrollbar(TScrollbar val) { FSetVertScrollbar(val); }
	//public property Visible();
	public TFreeviewType ViewType() { return FViewType; }
	public void ViewType(TFreeviewType val) { FSetViewType(val); }
	public TFreeViewportmode ViewportMode() { return FViewportMode; }
	public void ViewportMode(TFreeViewportmode val) { FSetViewportMode(val); }       // Switch between wireframe mode or differentypes of shading
	public TNotifyEvent OnChangeBackground() { return FOnChangeBackgroundImage; }
	public void OnChangeBackground(TNotifyEvent val) { FOnChangeBackgroundImage=val; }
	public TNotifyEvent OnChangeViewType() { return FOnChangeViewType; }
	public void OnChangeViewType(TNotifyEvent val) { FOnChangeViewType = val; }
	//public property OnKeyDown();
	//public property OnKeyPress();
	//public property OnKeyUp();
	public TMouseEvent OnMouseDown() { return FOnMouseDown; }
	public void OnMouseDown(TMouseEvent val) { FOnMouseDown=val; }
	public TMouseEvent OnMouseUp() { return FOnMouseUp; }
	public void OnMouseUp(TMouseEvent val) { FOnMouseUp = val; }
	public TMouseEvent OnMouseMove() { return FOnMouseMove; }
	public void OnMouseMove(TMouseEvent val) { FOnMouseMove = val; }
 	public TNotifyEvent OnMouseEnter() { return FOnMouseEnter; }
 	public void OnMouseEnter(TNotifyEvent val) { FOnMouseEnter = val; }
	public TNotifyEvent OnMouseLeave() { return FOnMouseLeave; }
	public void OnMouseLeave(TNotifyEvent val) { FOnMouseLeave = val; }
	//public property OnMouseWheel();
	//public Property OnResize();
	public TNotifyEvent OnRedraw() { return FOnRedraw; }
	public void OnRedraw(TNotifyEvent val) { FOnRedraw=val; }
	public TNotifyEvent OnRequestBackgroundImage() { return FOnRequestBackgroundImage; }
	public void OnRequestBackgroundImage(TNotifyEvent val) { FOnRequestBackgroundImage = val; }
	public TOnRequestExtentsEvent OnRequestExtents() { return FOnRequestExtents; }
	public void OnRequestExtents(TOnRequestExtentsEvent val) { FOnRequestExtents = val; }
}
